package com.ler.yrmall.enums;

/**
 * @author Leron
 * @version 1.0
 */
public enum ErrorCodeEnum {

    /**
     * 错误枚举
     */
    ES_CONNECT_ERROR(5001,"elasticsearch连接失败，请检查搜索服务是否正常!"),

    ES_DELETE_ERROR(5002,"elasticsearch商品删除失败，请检查搜索服务是否正常!"),

    SKU_FIND_ERROR(5003,"商品查询错误!"),

    WARE_SKU_DELETE_BEFORE(5004,"请先删除仓库!"),

    WARE_SKU_DELETE_FAIL(5005,"当前有商品锁定了库存,禁止删除!"),

    WARE_USED(5006,"当前仓库正在使用,禁止删除!"),

    PURCHASE_FINISH_ERROR(5007,"当前工作单已完成,禁止更新!"),

    ADD_CART_ERROR(5101,"加入购物车失败,请稍后再试!"),

    ORDER_TOKEN_LOSE(5102,"您在此页面停留的时间过长，请刷新页面后重试"),

    SKU_LOSE(5103,"当前商品中含有已下架的产品，请稍后再试"),

    SKU_NO_STOCK(5104,"当前商品中含有已下架的产品，请稍后再试"),

    COUPON_DISABLED(5105,"当前优惠券不可用"),

    CLIENT_DEFAULT_ERROR(5100,"系统错误,请稍后再试!");


    /**
     * 提示后台的状态码为 50 开头，提示客户的状态码为 51
     */
    private final Integer code;

    private final String message;

    ErrorCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
